<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>订单列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <link rel="stylesheet" href="{:_SKIN}/shadmin/v3//css/news.css" media="all"/>
    {:jq()}
</head>

<body class="childrenBody">
<blockquote class="layui-elem-quote news_search">

    <div class="layui-inline">
        <form action="">
        <div class="layui-input-inline">
            <input type="text" value="" name="key"  placeholder="请输入关键字" class="layui-input search_input" >
        </div>
        <div class="layui-input-inline">
            <input type="text" value="" name="ks" id="ks" placeholder="开始时间" class="layui-input search_input" >
        </div>

        <div class="layui-input-inline">
            <input type="text" value="" name="jz" id="jz" placeholder="截止时间" class="layui-input search_input" >
        </div>
        <button class="layui-btn search_btn layui-btn-danger">筛选</button>
        </form>
    </div>


    

    <div class="layui-inline">
        <div class="layui-form-mid layui-word-aux">　共找到 {:count($list)} 条</div>
    </div>
</blockquote>
<div class="layui-form news_list">
    <table class="layui-table">
        <colgroup>
           
            <col>
            <col>
            <col>
            <col>
            <col>
            <col>
            <col>
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>id</th>
            <th style="text-align:left;">订单内容</th>
            <th>价格</th>
            <th>收货人</th>
            <th>联系方式</th>
             <th>省市县</th>
            <th>收货地址</th>
            <th>下单时间</th>
            <!-- <th>状态</th> -->
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="news_content">
        {volist name="list" id="v"}
        <tr>
            <td>{$v.id}</td>
            <td align="left">{$v.title}</td>
            <td>{$v.money}</td>
            <td>{$v.name}</td>
            <td>{$v.tel}</td>
            <td>{$v.city}</td>
            <td>{$v.address}</td>
            <td>{$v.paytime}</td>
            <!-- <td>{$v.state==2?"已发货":"发货"}</td> -->
            <td>
                {if condition="$v.state eq 2"} <a id="tin-{$v.id}" onclick='ting(this,"{$v.id}")' class="layui-btn layui-btn-danger layui-btn-mini news_collect" id="getorder" style="background-color:{$v.state == 2 ?'red':'green'}">{$v.state == 2 ?"已发货":"发货"}</a>{else condition="$v.state eq 3"}<a id="tin-{$v.id}" onclick='ting(this,"{$v.id}")' class="layui-btn layui-btn-danger layui-btn-mini news_collect" id="getorder" style="background-color:{$v.state == 3 ?'red':'green'}">{$v.state == 3 ?"交易完成":"发货"}</a>{/if}
                
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
</div>

<div id="page">{$page}</div>

<style>
    .pagination { margin-left: 50px;}
    .pagination li { float: left; background: #34a8fe; color: #fff; margin-right:8px ; }
    .pagination li a,.pagination li span { color:#fff;padding: 8px 10px;display: block}
    .pagination .active  { background-color: #fe6738}

</style>

{:jq()}
{:layui()}
<script>

    layui.laydate.render({
        elem: '#ks'
        ,type: 'datetime'
    });

    layui.laydate.render({
        elem: '#jz'
        ,type: 'datetime'
    });
</script>
<script type="text/javascript">
     function ting(obj,id) {
            Up(id);

        }
        function Up(id) {
            id = parseInt(id);
            $.post('{:url('Seller/block')}', {id: id}, function(data) {
                if (data.status) {
                    var status = $('#vip-'+id).children('td').eq(11).text();
                    if(status=="发货"){
                        $('#tin-'+id).children('td').eq(11).html('已发货');
                    }else{
                        $('#tin-'+id).children('td').eq(11).html('停用');
                        $('#tin-'+id).html('已发货').css('background-color','red');
                    }
                }
            });
        }
</script>
</body>
</html>